<?php
namespace app\user\model\user;

use app\common\model\BaseModel;
use think\model\concern\SoftDelete;
use app\user\logic\user\Account as User;

/**
 * 关注模型
 */
class Follow extends BaseModel
{
    use SoftDelete;
    /**
     * 表名
     * @var string
     */
    protected $name = 'user_follow';

    /**
     * 设置自动写入时间
     * @var boolean
     */
    protected $autoWriteTimestamp = true;
    protected $updateTime = false;

    /**
     * 定义字段类型
     * @var array
     */
    protected $type = [
        'id'                => 'integer',
        'create_time'       => 'integer',
        'user_id'           => 'integer',
        'follow_user_id'    => 'integer',
    ];

    // 关联关注对象用户头像
    public function followUserInfo()
    {
        return $this->belongsTo(User::class)->with(['avatar_url'])->bind(['nick_name','signature','avatar_url']);
    }
}
